-
Notifications
You must be signed in to change notification settings - Fork 8.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement ScopedHistory.block #91099
Implement ScopedHistory.block #91099
Conversation
Pinging @elastic/kibana-core (Team:Core) |
@joshdover Now that we have this, do we want to deprecates |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for doing this. I just added a couple of NITs 😇
await testSubjects.existOrFail('navigationBlockConfirmModAl'); | ||
await PageObjects.common.clickConfirmOnModal(); | ||
expect(await browser.getCurrentUrl()).to.contain('/app/core_history_block/foo'); | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NIT: What happens if we navigate back to core_history_block
, do we get the confirmation again? Can we add a test to ensure we don't leave hanging Prompts? How about re-entering the app? Will it re-register the Prompt a 2nd time?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What happens if we navigate back to core_history_block, do we get the confirmation again?
In this specific test plugin's implementation, we don't, as we are using the Prompt
component on the /
page only, so the block handler will be disposed when leaving this specific page. I can add a test asserting this behavior, even if it's more the plugin's implementation detail we would be testing here.
Can we add a test to ensure we don't leave hanging Prompts? How about re-entering the app? Will it re-register the Prompt a 2nd time?
When re-entering the app, a new ScopedHistory
instance will be created, and the Prompt will be reattach from this new instance to the global history. The block handlers removal when the history changes from active to inactive is more heavily tested in the ScopedHistory's unit tests (which is way easier than from FTR).
Yes, let's mark it deprecated and open a new issue for migrating existing usages. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1-ing Vadim's approval - I assumed we were tagged in mostly for QA vs. code review, but you want a secondary reviewer as well feel free to shout (not sure how useful I'd be though :)
"server": false, | ||
"ui": true, | ||
"requiredBundles": ["kibanaReact"] | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just to confirm my understanding of this - if we want to use <Prompt>
, do we need to include this plugin in Enterprise Search as a required dependency? Or no/is it already baked in?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I imported it from react-router-dom
and it worked, so I guess it's baked in.
Feel free to correct me, if I'm wrong!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Na, everything is provided from core. I just used kibanaReact
in the test plugin for some utility functions
💚 Build SucceededMetrics [docs]Module Count
Page load bundle
History
To update your PR or re-run it, just comment with: |
* implements ScopedHistory.block * add FTR tests * fix test plugin id * update generated doc * deprecates AppMountParameters.onAppLeave * typo fix * add new FTR test * fix added test
* master: (36 commits) [Uptime] Thumbnail full screen view steps navigation fix (elastic#91895) Implement ScopedHistory.block (elastic#91099) [Lens] Fix overlowing content on a chart for charts and table (elastic#92006) handle source column differences in embeddable as well (elastic#91987) [Vega] [Map] disable map rotation using right right click / touch rotation gesture (elastic#91996) [Lens] Load indexpatterns list from indexPattern Service (elastic#91984) [coverage] ingest data in parallel (elastic#92074) [Lens] Drag and drop performance improvements (elastic#91641) A few more environment uiFilters fixes (elastic#92044) Enabling Uptime and Dashboard a11y test (elastic#91017) [Security Solution][Detections] Adds more granular validation for nested fields (elastic#92041) [Security Solution] [Detections] add overflow-wrap for description (elastic#91945) [Security Solution] [Detections] do not truncate filename in value list table in modal (elastic#91952) Skip flaky apm test elastic#91673 (elastic#92065) [docker] Default server.name to hostname (elastic#90799) Use documentation link service for snapshot restore (elastic#91596) [Security Solution] Clearing up all jest errors and warnings (elastic#91740) Add `@kbn/analytics` to UI Shared Deps (elastic#91810) [7.12][Telemetry] Add missing fields for security telemetry (elastic#91920) [Security Solution] Adds cypress-pipe (elastic#91550) ...
Summary
Fix #88896
Checklist